<?php $__env->startSection('main'); ?>

<!-- 引入CSS -->
<link rel="stylesheet" href="/up/uploadify.css">

<!-- 引入JQ -->
<!--引入过了-->
<!-- 引入文件上传插件 -->
<script src="/up/jquery.uploadify.min.js"></script>


<!-- 内容 -->
			<div class="col-md-10">
				
				<ol class="breadcrumb">
					<li><a href="#"><span class="glyphicon glyphicon-home"></span> 首页</a></li>
					<li><a href="<?php echo e(asset('admin/pic')); ?>">图片管理</a></li>
					<li class="active">图片添加</li>

					<button class="btn btn-primary btn-xs pull-right"><span class="glyphicon glyphicon-refresh"></span></button>
				</ol>

				<!-- 面版 -->
				<div class="panel panel-default">
					<div class="panel-heading">
						<a href="<?php echo e(asset('admin/pic')); ?>" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span> 图片页面</a>
						<a href="<?php echo e(asset('admin/pic/create')); ?>" class="btn btn-success"><span class="glyphicon glyphicon-plus"></span> 添加图片</a>
						
						


					</div>
					<div class="panel-body">
						<form action="<?php echo e(asset('admin/pic')); ?>" method="post">
							<div class="form-group">
							<?php echo e(csrf_field()); ?>


								<label for="">Title</label>	
								<input type="text" name="title" class="form-control" id="">
							</div>
							<div class="form-group">
								<label for="">SORT</label>
								<input type="text" name="sort" class="form-control" id="">
							</div>
							
							<div class="form-group">
								<label for="">IMG</label>
								
								<input type="file" name="" id="uploads">
								<div id="main"></div>
								
								<input type="hidden" name="img" id="imgs">
							</div>
		

							<div class="form-group">
								<input type="submit" value="提交" class="btn btn-success">
								<input type="reset" value="重置" class="btn btn-danger">
							</div>

						</form>
					</div>
					
				</div>
			</div>
			<script>
				//当所有HTML代码都加载完毕
				$(function(){
					//声明字符串
					var imgs="";
					
					//使用 uploadify 插件
					$('#uploads').uploadify({
						//设置文本
						'buttonText':'图片上传 美照',
						//设置文件传输数据
						'formData':{
							'_token':'<?php echo e(csrf_token()); ?>',
							'files':'Goods',
						},
						//上传的flash动画
						'swf' :"/up/uploadify.swf",
						//文件上传地址
						'uploader':"<?php echo e(asset('admin/shangchuan')); ?>",
						//当文件上传成功
						'onUploadSuccess':function(file,data,response){
						
							//alert(data);
							
							//拼接字符串
							imgs="<img width='200px' src='/Uploads/Goods/"+data+"'>";
							//展示图片
							$("#main").html(imgs);
							//隐藏域传递数据
							$('#imgs').val(data);
							
						}
						
					});
					
				});
			
			</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make("muban.admin", array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>